package com.test;

//坦克类
class Tank
{
	int x = 0;//表示坦克横坐标
	int y = 0;//表示坦克纵坐标
	//tank 方向 1上 2下 3左 4右
	int direct = 1;
	
	int speed=2;
	
	public int getSpeed() {
		return speed;
	}
	public void setSpeed(int speed) {
		this.speed = speed;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	public Tank(int x ,int y){
		this.x = x;
		this.y = y;
	}
	public int getDirect() {
		return direct;
	}
	public void setDirect(int direct) {
		this.direct = direct;
	}
}
class Hero extends Tank
{
	public Hero(int x, int y) {
		super(x, y);
	}
	//坦克向上移动
	public void moveup() {
		y -=speed;
	}
	//坦克向下移动
	public void moveDown() {
		y +=speed;
	}	
	//坦克向左移动
	public void moveLeft() {
		x -=speed;
	}
	//坦克向上移动
	public void moveRight() {
		x +=speed;
	}	
}

class EnemyTank extends Tank{
	int direct = 2;
	public int getDirect() {
		return direct;
	}
	public void setDirect(int direct) {
		this.direct = direct;
	}
	public int getColor() {
		return color;
	}
	public void setColor(int color) {
		this.color = color;
	}
	int color = 2;
	public EnemyTank(int x, int y){
		super(x,y);
	}
}
